package com.example.cpms.mapper;

import com.example.cpms.entity.Building;
import com.example.cpms.entity.RodManage;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface RodManageMapper {
    /**
     * 一体杆分页查询
     * @param poleName poleNumber PoleStatus
     * @return
     */
    List<RodManage> list(String poleName, String poleNumber, Integer poleStatus);

    /**
     * 删除一体杆
     * @param id
     */
    @Delete("delete from rodManage where id = #{id}")
    void delete(Integer id);

    /**
     * 添加一体杆
     * @param rodManage
     */
    @Insert("insert into rodManage(poleName, poleNumber, poleIp, areaName, poleStatus) " +
            "values (#{poleName},#{poleNumber},#{poleIp},#{areaName},#{poleStatus})")
    void insert(RodManage rodManage);

    /**
     *更新一体杆
     * @param rodManage
     */
    @Update("update rodManage set poleName = #{poleName}, poleNumber= #{poleNumber}, poleIp = #{poleIp}, " +
            "areaName = #{areaName}, poleStatus = #{poleStatus} where id = #{id} ")
    void update(RodManage rodManage);
}
